all:
	@echo -ne "Please do as follows:\n 1. Run [make getpos]\n 2. Translate strings in po-files\n 3. Run [make getmos]\n 4. Run [sudo make install]\n "

getpos:
	find ../src -name "*.vala" > komorebi.in
	find ../extra -name "*.vala" >> komorebi.in
	xgettext -f komorebi.in -d komorebi --keyword=_ --from-code=UTF-8

getmos:
	msgfmt -o komorebi.mo komorebi.po

install:
	cp komorebi.mo /usr/local/share/locale/zh_CN/LC_MESSAGES/

clean:
	rm -f komorebi.in komorebi.po komorebi.mo

test:
	@python -c 'import gettext; gettext.bindtextdomain("komorebi", "/usr/local/share/locale"); print gettext.dgettext("komorebi", "Welcome to Komorebi\n")';\
	python -c 'import gettext; gettext.bindtextdomain("komorebi", "/usr/local/share/locale"); print gettext.dgettext("komorebi", "Move to Trash")';\
	python -c 'import gettext; gettext.bindtextdomain("komorebi", "/usr/local/share/locale"); print gettext.dgettext("komorebi", "Trash")'
